import request from "@/utils/request.js";
/**
 *
 * 所有活动接口 包括：拼团，砍价，秒杀,抽奖
 *
*/

/**
 * 拼团列表
 *
*/
export function getCombinationList(data) {
  return request.get('combination/list', data,{noAuth:true});
}

/**
 * 拼团详情
 *
*/
export function getCombinationDetail(id) {
  return request.get('combination/detail/'+id, {}, {noAuth: true});
}

/**
 * 拼团 开团
 */
export function getCombinationPink(id) {
  return request.get("combination/pink/" + id);
}

/**
 * 拼团 取消开团
 */
export function postCombinationRemove(data) {
  return request.post("combination/remove",data);
}

/**
 * 拼团 更多拼团
 */
export function getCombinationMore(data) {
  return request.get("combination/more",data,{noAuth:true});
}


/**
 * 秒杀产品时间区间
 *
*/
export function getSeckillIndexTime(){
  return request.get('seckill/index',{},{noAuth:true});
}

/**
 * 秒杀产品列表
 * @param int time
 * @param object data
*/
export function getSeckillList(time,data){
  return request.get('seckill/list/'+time,data,{noAuth:true});
}

/**
 * 秒杀产品详情
 * @param int id
*/
export function getSeckillDetail(id){
  return request.get('seckill/detail/'+id, {}, {noAuth: true});
}

/**
 * 砍价海报
 * @param object data
 *
*/
export function getBargainPoster(data){
  return request.post('bargain/poster',data)
}

/**
 * 拼团海报
 * @param object data
 *
*/
export function getCombinationPoster(data){
  return request.post('combination/poster',data)
}

/**
 * 砍价取消
 */
export function getBargainUserCancel(data) {
  return request.post("/bargain/user/cancel", data);
}

/**
 * 获取秒杀小程序二维码
 */
export function seckillCode(id,data) {
  return request.get("seckill/code/"+id,data);
}

/**
 * 获取拼团小程序二维码
 */
export function scombinationCode(id) {
  return request.get("combination/code/"+id);
}

/**
 * 秒杀产品时间区间
 * @param int id
*/
export function getSeckillHeaderApi(){
  return request.get('seckill/header',{},{noAuth:true});
}

/**
 * 首页秒杀产品列表
*/
export function getSeckillIndexApi(){
  return request.get('seckill/index',{},{noAuth:true});
}


/**
 * 首页拼团产品列表
*/
export function getCombinationIndexApi(){
  return request.get('combination/index',{},{noAuth:true});
}

/**
 * 首页砍价产品列表
*/
export function getBargainIndexApi(){
  return request.get('bargain/index',{},{noAuth:true});
}

/**
 * 首页砍价产品列表
*/
export function bargainHeaderApi(){
  return request.get('bargain/header');
}

/**
 * 拼图列表头部
*/
export function combinationHeaderApi(){
  return request.get('combination/header');
}

/**
 * 抽奖  通知
*/
export function cj_event(){
  return request.get('activity/event');
}


/**
 * 抽奖  分页列表
*/
export function drawList(data){
  return request.get('activity/draw/list',data,{noAuth:true});
}


/**
 * 创建抽奖
*/
export function creatDraw(data){
  return request.post('activity/admin/draw/save',data);
}


/**
 * 优惠券列表 商家
*/
export function couponlist(data){
  return request.get('coupon/admin/list',data);
}


/**
 * 抽奖详情
*/
export function drawInfo(id){

  return request.get("activity/draw/info/"+id,{}, {noAuth:true} );
}

/**
 * 抽奖详情商家
*/
export function drawInfoStore(id){

  return request.get("activity/admin/draw/info/"+id);
}

export function drawUpdate(data){

  return request.post("activity/admin/draw/update",data);
}
/**
 * 参与抽奖
*/
export function drawSubmit(data){

  return request.post("activity/draw/submit",data);
}

/**
 * 参与抽奖记录
*/
export function drawRcord(data){

  return request.get("activity/draw/recordList",data,{noAuth:true});
}
/**
 * 参与抽奖记录(商家)
*/
export function drawRcordStore(data){

  return request.get("activity/admin/draw/recordList",data);
}

/**
 * 随机下个
*/
export function drawNext(data){

  return request.get("activity/draw/next?currentId="+data.currentId, data,{noAuth:true});
}

/**
 * 购买抽奖次数
*/
export function drawBuytime(data){
	
  return request.post("activity/draw/buyTime",data);
}
/**
 *抽奖次数记录
*/
export function drawtimelist(data){
	
  return request.get("activity/draw/timeList",data);
}
/**
 * 商家详情
*/
export function storeInfo(data){

	return request.get("merchant/relateInfo",data);
}
/**
 * 用户订阅
*/
export function storesubscribe(data){

	return request.get("merchant/subscribe",data);
}
/**
 * 我的订阅
*/
export function subscribelistnew(data){

	return request.get("merchant/subscribe/list",data);
}

// merchant/admin/subscribe/listAll 所有粉丝
export function subscribeAll(data){

	return request.get("merchant/admin/subscribe/listAll",data);
}

// 取关粉丝
export function banFans(data){

	return request.get("merchant/admin/unsubscribe",data);
}


/**
 * 查询开奖结果
*/
export function drawOpen(data){

	return request.get("activity/draw/openResult",data);
}



/**
 * 我的中奖奖品
*/
export function recordListPrize(data){

	return request.get("activity/draw/recordList/prize",data);
}

/**
 * 奖品兑换
*/
export function prizeApply(data){

	return request.post("activity/draw/prize/apply",data);
}
/**
 * 中奖核销列表
*/
export function recordListWriteOff(data){

	return request.get("activity/admin/draw/recordList/writeOff",data);
}
/**
 * 奖品出奖
*/
export function prizeSend(data){

	return request.post("activity/admin/draw/prize/send",data);
}

/**
 * 扫码核销用户
*/
export function yhsaoprize(id){

	return request.post("activity/draw/prize/writeOff?recordId="+id);
}
/**
 * 商家核销扫码
*/
export function sjsaoprize(id){

	return request.post("activity/admin/draw/prize/writeOff?recordId="+id);
}
/**
 * 中奖优惠券
*/
export function prizeCoupon(data){

	return request.get("activity/draw/recordList/coupon",data);
}

/**
 * 商家创建的列表
*/
export function merchantList(data){

	return request.get("activity/admin/marketing/merchantList",data);
}

/**
 * 删除创建的抽奖
*/
export function drawDele(data){

	return request.get("activity/admin/draw/delete",data);
}
